home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / TESTING / ARRAYMOV.PAS next >
Pascal/Delphi Source File  |  1996-08-16  |  1KB  |  35 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Testing; element moving and pulling within array lists
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDAT, EFLIBTXT;
  10.  
  11. const TestSize = 15;
  12.  
  13. var MyArray : ArrayListObjectType; Data : string;
  14.     Index : word;
  15.  
  16. begin
  17.      with MyArray do begin
  18.           Initialize (TestSize, 11);
  19.  
  20.           { Add some elements }
  21.           for Index := 1 to 10 do begin
  22.               Data := StringNumber(Index, 0, 0);
  23.               Add (Data); end;
  24.  
  25.           Erase (1); Erase (2); Erase(3); PullElements;
  26.           Erase(4);
  27.  
  28.           { Display usage status }
  29.           for Index := 1 to Capacity do
  30.               if IsUsed(Index) then WriteLn (String(ElementPointer(Index)^))
  31.                  else WriteLn ('*NOT USED*');
  32.  
  33.           Intercept;
  34.      end;
  35. end.